package com.egame.ewidget;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.NotificationCompat;
import android.support.v7.app.ActionBarActivity;

import com.egame.ewidget.provider.SwitchReceiver;

public class MainActivity extends ActionBarActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
				this);
		mBuilder.setSmallIcon(R.drawable.ic_launcher);
		mBuilder.setOngoing(true);
		mBuilder.setPriority(NotificationCompat.PRIORITY_MAX);
		

		int[] statusesArray = SwitchReceiver.setStaticStatus(this);
		SwitchReceiver.updateSwitchGUI(this, mBuilder, statusesArray);
		
		Notification notification = mBuilder.build();
		notification.when = 100;

		NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
		mNotificationManager.notify(SwitchReceiver.NOTIFICATION_ID,
				notification);
	}

}
